<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>我的订单 - <?= $systemConfig['system_name'] ?? '' ?></title>
<link rel="stylesheet" href="/layui/css/layui.css">
<script src="/static/js/jquery.min.js"></script>
<script src="/layui/layui.js"></script>
<style>*{margin:0;padding:0;box-sizing:border-box;}body{background:#f5f7fa;font-family:"Microsoft YaHei","PingFang SC",sans-serif;}
.header{background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.08);}.header .inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:0 20px;height:60px;}
.header .logo{font-size:20px;font-weight:700;color:#1e3c72;text-decoration:none;}.header .nav{display:flex;gap:16px;}
.header .nav a{color:#555;text-decoration:none;font-size:14px;padding:8px 12px;border-radius:4px;}.header .nav a:hover{color:#1e9fff;background:#f0f7ff;}
.container{max-width:1100px;margin:0 auto;padding:20px;}</style>
</head>
<body>
<div class="header"><div class="inner">
    <a href="/" class="logo"><?= $systemConfig['system_name'] ?? '' ?></a>
    <div class="nav"><a href="/user/index/dashboard">控制台</a><a href="/user/index/packages">套餐市场</a><a href="/user/index/myApps">我的应用</a><a href="/user/index/callStats">调用统计</a><a href="/user/index/myOrders">我的订单</a><a href="/user/index/myPackages">已购套餐</a><a href="/user/index/recharge">余额充值</a><a href="/user/index/apiDoc">接入文档</a><a href="/user/index/profile"><?= $userInfo['nickname'] ?? $userInfo['username'] ?></a><a href="/user/index/logout">退出</a></div>
</div></div>
<div class="container">
    <table class="layui-table" lay-size="sm">
        <thead><tr><th>订单号</th><th>套餐</th><th>金额</th><th>状态</th><th>支付方式</th><th>时间</th></tr></thead>
        <tbody>
            <?php foreach($orders as $o): ?>
            <tr><td><?= $o['order_no'] ?></td><td><?= $o['package_name'] ?></td><td>¥<?= number_format($o['amount'], 2) ?></td>
                <td><?php if($o['pay_status']==1) echo '<span style="color:green">已支付</span>'; elseif($o['pay_status']==2) echo '<span style="color:red">已失效</span>'; else echo '<span style="color:orange">待支付</span>'; ?></td>
                <td><?= $o['pay_type'] ?? '-' ?></td><td><?= $o['create_time'] ?></td></tr>
            <?php endforeach; ?>
            <?php if(empty($orders)): ?><tr><td colspan="6" style="text-align:center;color:#999;">暂无订单</td></tr><?php endif; ?>
        </tbody>
    </table>
</div>
</body>
</html>